/*************************************************************************
    > File Name: code.c
    > Author: ma6174
    > Mail: ma6174@163.com 
    > Created Time: Thu 20 Feb 2025 12:38:55 PM CST
 ************************************************************************/

#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>                //定义pit_t类型(进程ID的数据类型)
#include<unistd.h>                   //声明geipid()和getppid()函数

int main()
{
	pid_t id = getpid();
	pid_t parent = getppid(); 
	while(1)
	{
		printf("I am process! pid: %d, ppid:%d\n",id,parent);
		sleep(1);
	}
	return 0;
}

